package com.ruoyi.common.constant.heytalk;

import com.ruoyi.common.constant.heytalk.utils.CodeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 相关常量
 * @author zhusy
 * @since 2021/11/9
 */
public class CommonConstants {

    /**
     * 重复标识
     */
    public static final String NOT_UNIQUE = "1";

    /**
     * 未重复标识
     */
    public static final String UNIQUE = "0";

    /**
     * 登录用户 redis key
     */
    public static final String LOGIN_HEYTALK_TOKEN_KEY = "login_heytalk_tokens:";

    /**
     * token令牌前缀
     */
    public static final String HEYTALK_TOKEN_PREFIX = "HeyTalkBearer ";

    /**
     * 令牌前缀
     */
    public static final String LOGIN_HEYTALK_USER_KEY = "login_heytalk_user_key";

    /**
     * 用户ID标识
     */
    public static final String USER_ID = "userId";

    /**
     * 嗨聊通讯APP接口访问统一前缀地址
     */
    public static final String HEY_TALK = "/heyTalk";

    /**
     * redis消息缓存key
     */
    public static final String CHAT_MESSAGE = "getMessage_";

    /**
     * ws协议
     */
    public static final String WS_PROTOCOL = "ws:/";

    public static final String PLUS = "+";

    public static final String GROUP_NAME = "(群)";

    /**
     * 创建群聊成功后的提示信息
     */
    public static final String GROUP_SUCCESS_MSG = "创建群聊成功，可以开始聊天啦";

    /**
     * 用户性别枚举类型
     */
    @Getter
    @AllArgsConstructor
    public enum UserSexEnum {
        MALE(0,"男"),
        FEMALE(1,"女"),
        UNKNOWN(2,"未知");
        private Integer code;
        private String name;
    }

    /**
     * 用户状态枚举类型
     */
    @Getter
    @AllArgsConstructor
    public enum UserStatusEnum {
        NORMAL(0,"禁用"),
        DEACTIVATE(1,"正常")
        ;

        private Integer code;
        private String name;
    }

    /**
     * 被申请方状态枚举类型
     */
    @Getter
    @AllArgsConstructor
    public enum BApplyStatusEnum implements CodeEnum {
        PENDING("pending", "同意"),
        REFUSE("refuse", "拒绝"),
        AGREE("agree", "已添加"),
        IGNORE("ignore", "忽略");

        private String code;
        private String name;

    }

    /**
     * 申请方状态枚举类型
     */
    @Getter
    @AllArgsConstructor
    public enum ApplyBStatusEnum implements CodeEnum {
        AWAIT_VERIFY("awaitVerify", "等待验证"),
        VERIFY_OK("verifyOk", "验证通过");

        private String code;
        private String name;
    }

    /**
     * 看我枚举类型
     */
    @Getter
    @AllArgsConstructor
    public enum LookMeEnum {
        ONE(1, "不看"),
        ZERO(0, "看我");

        private Integer code;
        private String name;
    }

    /**
     * 看他枚举类型
     */
    @Getter
    @AllArgsConstructor
    public enum LookHimEnum {
        ONE(1, "不看"),
        ZERO(0, "看他");

        private Integer code;
        private String name;
    }

    /**
     * 是否为星标朋友枚举类型
     */
    @Getter
    @AllArgsConstructor
    public enum StarEnum {
        ZERO(0, "否"),
        ONE(1, "是");

        private Integer code;
        private String name;
    }

    /**
     * 是否加入黑名单枚举类型
     */
    @Getter
    @AllArgsConstructor
    public enum IsBlackEnum {
        ZERO(0, "否"),
        ONE(1, "是");

        private Integer code;
        private String name;
    }

    /**
     * 聊天消息类型
     */
    @Getter
    @AllArgsConstructor
    public enum ChatMsgTypeEnum implements CodeEnum {
        EMOTICON("emoticon", "表情"),
        TEXT("text", "文字"),
        IMAGE("image", "图片"),
        VIDEO("video", "视频"),
        AUDIO("audio", "音频"),
        CARD("card", "卡片")
        ;

        private String code;
        private String name;
    }

    /**
     * 数据类型枚举
     */
    @Getter
    @AllArgsConstructor
    public enum DataTypeEnum implements CodeEnum {
        TIPS("tips", "提示类消息"),
        RECALL("recall", "聊天消息撤回"),
        UPDATE_APPLY_LIST("updateApplyList", "新的好友申请"),
        MOMENT("moment", "朋友圈更新"),
        CHAT("chat", "聊天类消息"),
        SYSTEM("system", "系统消息"),
        ;

        private String code;
        private String name;
    }

    /**
     * 消息接收类型枚举
     */
    @Getter
    @AllArgsConstructor
    public enum ChatTypeEnum implements CodeEnum {
        SINGLE_CHAT("user", "单发"),
        GROUP_CHAT("group", "群发"),
        ;

        private String code;
        private String name;

    }

    /**
     * 消息是否撤回枚举类型
     */
    @Getter
    @AllArgsConstructor
    public enum IsRemoveEnum {
        ZERO(0, "否"),

        ;

        private Integer code;
        private String name;
    }

}
